package com.yq.day30.udp1.v2;

import com.yq.utils.NetUtils;

import javax.xml.transform.Source;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;

/**
 * @author 3307235355@qq.com
 * @description
 * @since 2022/06/30 16:46
 */
public class Receive {
    public static void main(String[] args) throws IOException {
        DatagramSocket socket = new DatagramSocket(9999);
        DatagramPacket receivePacket = NetUtils.getReceivePacket();
        socket.receive(receivePacket);
        String parse = NetUtils.parse(receivePacket);
        System.out.println(receivePacket.getSocketAddress()+"====="+parse);
        socket.close();

    }
}
